package com.tsll.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @TableName expenditure
 */
public class Expenditure implements Serializable {
    /**
     * 部门支持编号
     */
    private Integer expenditureId;

    /**
     * 支出金额
     */
    private Double amount;

    /**
     * 支出描述
     */
    private String expenditureDescribe;

    /**
     * 支出时间 
     */
    @DateTimeFormat(pattern= "yyyy-MM-dd")
    @JsonFormat(pattern= "yyyy-MM-dd",timezone = "GMT+8")
    private Date expenditureData;

    /**
     * 部门id
     */
    private Integer deptId;

    /**
     * 部门
     */
    private Department department;

    private static final long serialVersionUID = 1L;

    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }

    /**
     * 部门支持编号
     */
    public Integer getExpenditureId() {
        return expenditureId;
    }

    /**
     * 部门支持编号
     */
    public void setExpenditureId(Integer expenditureId) {
        this.expenditureId = expenditureId;
    }

    /**
     * 支出金额
     */
    public Double getAmount() {
        return amount;
    }

    /**
     * 支出金额
     */
    public void setAmount(Double amount) {
        this.amount = amount;
    }

    /**
     * 支出描述
     */
    public String getExpenditureDescribe() {
        return expenditureDescribe;
    }

    /**
     * 支出描述
     */
    public void setExpenditureDescribe(String expenditureDescribe) {
        this.expenditureDescribe = expenditureDescribe;
    }

    /**
     * 支出时间 
     */
    public Date getExpenditureData() {
        return expenditureData;
    }

    /**
     * 支出时间 
     */
    public void setExpenditureData(Date expenditureData) {
        this.expenditureData = expenditureData;
    }

    /**
     * 部门id
     */
    public Integer getDeptId() {
        return deptId;
    }

    /**
     * 部门id
     */
    public void setDeptId(Integer deptId) {
        this.deptId = deptId;
    }

    public Expenditure() {
    }

    public Expenditure(Integer expenditureId, Double amount, String expenditureDescribe, Date expenditureData, Integer deptId) {
        this.expenditureId = expenditureId;
        this.amount = amount;
        this.expenditureDescribe = expenditureDescribe;
        this.expenditureData = expenditureData;
        this.deptId = deptId;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Expenditure other = (Expenditure) that;
        return (this.getExpenditureId() == null ? other.getExpenditureId() == null : this.getExpenditureId().equals(other.getExpenditureId()))
            && (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount()))
            && (this.getExpenditureDescribe() == null ? other.getExpenditureDescribe() == null : this.getExpenditureDescribe().equals(other.getExpenditureDescribe()))
            && (this.getExpenditureData() == null ? other.getExpenditureData() == null : this.getExpenditureData().equals(other.getExpenditureData()))
            && (this.getDeptId() == null ? other.getDeptId() == null : this.getDeptId().equals(other.getDeptId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getExpenditureId() == null) ? 0 : getExpenditureId().hashCode());
        result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode());
        result = prime * result + ((getExpenditureDescribe() == null) ? 0 : getExpenditureDescribe().hashCode());
        result = prime * result + ((getExpenditureData() == null) ? 0 : getExpenditureData().hashCode());
        result = prime * result + ((getDeptId() == null) ? 0 : getDeptId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", expenditureId=").append(expenditureId);
        sb.append(", amount=").append(amount);
        sb.append(", expenditureDescribe=").append(expenditureDescribe);
        sb.append(", expenditureData=").append(expenditureData);
        sb.append(", deptId=").append(deptId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}